package com.hxzy.cms.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.StringRedisTemplate;

@Configuration
public class RedisConfig {


    /**
     * 配置一个只允许操作字符串的redis
     * @return
     */
    @Bean
    public StringRedisTemplate  stringRedisTemplate(LettuceConnectionFactory redisConnectionFactory){
        StringRedisTemplate stringRedisTemplate= new StringRedisTemplate();
        stringRedisTemplate.setConnectionFactory(redisConnectionFactory);
        return stringRedisTemplate;
    }


}
